var base64 = require("../weui/example/images/base64");
//获取应用实例
const app = getApp()

Page({
  data: {
    imageSrc: ['../pageImages/4_1.jpg'],
    indicatorDots: false,
    vertical: true,
    autoplay: true,
    interval: 2000,
    duration: 500,
    userId: null,
    wh:0
  },
  goBack: function(){
    wx.navigateBack({
      delta: 1 //返回的页面数，如果 delta 大于现有页面数，则返回到首页,
    });
  },
  onLoad: function () {
    this.setData({
      icon20: base64.icon20,
      icon60: base64.icon60
    });
    if (app.globalData.userId) {
      this.setData({
        userId: app.globalData.userId
      })
    }
  },
  onShow: function () {
    if (app.globalData.userId != null) {
      this.setData({
        userId: app.globalData.userId
      });
    }
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          "wh": res.windowHeight - 48 -wx.getSystemInfoSync().statusBarHeight
        })
      }
    })
  },
  toCostbase: function () {
    if (this.data.userId == null) {
      wx.navigateTo({
        url: '../binduser/binduser'
      })
    }
    wx.navigateTo({
      url: '../costbase/costbase'
    })
  }
})
